Skip to content

Concurrent read#79

Closed
icristescu wants to merge 1 commit intomirage:masterfrom
icristescu:concurrent_bench
Closed

Concurrent read#79
icristescu wants to merge 1 commit intomirage:masterfrom
icristescu:concurrent_bench

Conversation

@icristescu
Copy link
Contributor

No description provided.

@icristescu icristescu marked this pull request as ready for review September 9, 2019 14:30
let r = Index.v ~fresh:false ~readonly:true ~log_size index_name in
Fmt.epr "\n Read in readonly index. \n";
let count = ref 0 in
Index.iter
Copy link
Member

@samoht samoht Sep 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work when the index is updated concurrently? e.g. will newly written elements be read too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for readonly instances. Fixed by #81 .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think I understand what you meant now.
The iter indeed won't see the elements added after it was called., so this bench will only read the elements that were there from previous benchs.

@pascutto
Copy link
Contributor

Can this bench be integrated to main.ml ? I feel like the file is short enough for now to avoid having to deal with multiple files/open.
Or if we really want to split, we can think of a better architecture (and apply it to the tests too)

@icristescu
Copy link
Contributor Author

Can this bench be integrated to main.ml ? I feel like the file is short enough for now to avoid having to deal with multiple files/open.

I can integrate it but I'm not sure we should, as it does not really belong to benchmarking. It is actually a test that uses the heavy adds and reads of bench.

Or if we really want to split, we can think of a better architecture (and apply it to the tests too)

I think it is a bit difficult to copy the architecture of Irmin tests for example, because here we have a lot of tests that use fork. Whenever there is a fork all tests that follow are run twice, so we have to be careful to separate the tests properly, and I haven't yet figured out a way to do it.

@icristescu
Copy link
Contributor Author

These tests are less complete than the ones in PR #83 so I'm closing this PR.

@icristescu icristescu closed this Sep 11, 2019
@icristescu icristescu deleted the concurrent_bench branch September 11, 2019 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants